var as = document.querySelectorAll(".tab-nav a");
console.log(as);
var tabs = document.querySelectorAll(".tabs .tab");
console.log(tabs);
for (var i = 0; i < as.length; i++) {
    as[i].index = i;
    as[i].onclick = function() {
        for (var j = 0; j < as.length; j++) {
            as[j].className = "";
            tabs[j].classList.remove("currents");
        }
        this.className = "current";
        tabs[this.index].classList.add("currents");
    }
}